# -*- coding:utf-8 -*-

# 2. 在子模块中添加蓝图对象,实现路由定义
import logging
from flask import session
# print '导入 api begin'
from ihome.api_1_0 import api
# print '导入 api ends'


@api.route('/index', methods=['GET', 'POST'])
def index():
    print '访问首页'
    return 'welcome to visit this station'


@api.route('/get_session', methods=['GET', 'POST'])
def get_session():
    session['name'] = 'itcast'
    return 'session set successful'


@api.route('/show_bug', methods=['GET', 'POST'])
def show_bug():
    logging.fatal('fatal')
    logging.error('error')
    logging.warn('warn')
    logging.info('info')
    logging.debug('debug')

    return 'show bug suceess'
